<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org"
      xmlns:layout="http://www.ultraq.net.nz/thymeleaf/layout"
      layout:decorate="~{layout/layout}">
<head>

</head>
<body>
<div layout:fragment="content">
    <h1 th:text="#{user.inf}">员工信息</h1>
    <div align="center" th:if="${message != null}" class="error" th:text="${message}">错误消息</div>
    <div>
        <table class="table table-striped table-bordered">
            <thead>
            <tr>
                <th th:text="#{no}">序号</th>
                <th th:text="#{user.name}">名字</th>
                <th th:text="#{user.address}">地址</th>
                <th th:text="#{user.telephone}">电话</th>
                <th th:text="#{user.idCard}">身份证</th>
                <th th:text="#{user.jobNumber}">工号</th>
                <th th:text="#{user.morningDate}">早班日期</th>
                <th th:text="#{user.enable}">是否在职</th>
                <th th:text="#{edit}">编辑</th>
                <th th:text="#{delete}">删除</th>
            </tr>
            </thead>
            <tbody>
            <tr th:each="user,stat : ${userList}">
                <td th:text="${stat.count}">序号</td>
                <td th:text="${user.name}">名字</td>
                <td th:text="${user.address}">地址</td>
                <td th:text="${user.telephone}">电话</td>
                <td th:text="${user.idCard}">身份证</td>
                <td th:text="${user.jobNumber}">工号</td>
                <td th:text="${user.morningDate}">早班日期</td>
                <td th:text="${user.enable ? #messages.msg('enable') : #messages.msg('unable')}">是否在职</td>
                <td><a th:href="@{/admin/user/edit(id=${user.id})}" th:text="#{edit}">编辑</a></td>
                <td><a th:href="@{/admin/user/delete(id=${user.id})}" th:text="#{delete}">删除</a></td>
            </tr>
            </tbody>
        </table>

        <div class="form-group">
            <div class="col-sm-12 control-label">
                <a href="/admin/user/add" th:href="@{/admin/user/add}" class="btn btn-info" th:text="#{add}">添加</a>
            </div>
        </div>
    </div>
</div>
</body>
</html>